﻿<UserControl x:Class="ScrumFactory.Windows.AlertMessage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             Visibility="Collapsed"
             mc:Ignorable="d" 
             d:DesignHeight="80" d:DesignWidth="300">
    <Border 
        Style="{StaticResource AlertBorder}"                
                HorizontalAlignment="Stretch" >
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>            
            <Image Grid.Column="0" 
               VerticalAlignment="Top"
               Source="{Binding ImageSource}" Margin="0,0,10,0"
               Width="48" Height="48" Stretch="Uniform">
                <Image.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ImageSource}" Value="{x:Null}">
                                <Setter Property="Image.Visibility" Value="Collapsed"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
            <StackPanel Grid.Column="1">
                <TextBlock FontWeight="Bold" Foreground="{StaticResource AlertBrush}" Text="{Binding Title}" TextWrapping="Wrap" Margin="0,0,0,7"/>
                <TextBlock Text="{Binding Message}" TextWrapping="Wrap" Foreground="Black"/>
            </StackPanel>
            <Button Grid.Column="1"
                    HorizontalAlignment="Right" VerticalAlignment="Top"
                    Command="{Binding CloseWindowCommand}"
                    Style="{StaticResource CloseButton}"
                    BorderBrush="{StaticResource AlertBrush}"
                    Background="{StaticResource AlertSubBrush}"/>

        </Grid>
    </Border>
</UserControl>
